home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_26884.txt < prev    next >
Text File  |  1991-02-27  |  843b  |  25 lines

  1. -- card: 26884 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. ENUMERATION TYPES
  11.  
  12. An enumeration type is used to define a variable which can take on only one of a set of values, to improve program clarity.  A comma-separated list of identifiers for these values is given.  These identifiers are internally treated as integer constants representing their position in the list, starting with 0.  The list is NOT terminated with a semicolon.
  13.  
  14.     enum    day_of_week
  15.     {
  16.         Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday 
  17.     };
  18.  
  19. The syntax for declaring a variable of this type is similar to that for declaring a struct or union variable: 
  20.  
  21.     enum day_of_week  today;
  22.  
  23. -- part contents for background part 7
  24. ----- text -----
  25. 73